﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UCF.Core.Web.CustomControls
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:BreadCrumb runat=server></{0}:BreadCrumb>")]
    [ParseChildren(true)]
    public class BreadCrumb : Control, INamingContainer
    {

        [TemplateContainer(typeof(DataTemplateContainer))]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [AttributeProvider("Url","Url")]
        public virtual ITemplate Itemx { get; set; }


        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }
        protected override void Render(HtmlTextWriter writer)
        {
            writer.Write(this.Controls.Count.ToString());
        }
        public class DataTemplateContainer :Control, INamingContainer
        {
            public string Url { get; set; }
            public string Text { get; set; }
            public DataTemplateContainer(string text, string url)
            {
                this.Text = text;
                this.Url = url;
            }
        }
    }
}
